<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>审图单位--提交报价</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/templates/act/process-xl.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style>
        body {
            box-sizing: border-box;
            -moz-box-sizing:border-box; /* Firefox */
            -webkit-box-sizing:border-box; /* Safari */
            padding: 30px 30px;
        }
        p {
            text-indent: 25px
        }
        h3 {
            font-weight: bold;
            display: inline;
        }
        .offer {
            display: inline;
            position: absolute;
            right: 10%;
        }
        .layui-table th {
            text-align: center;
        }
        table {
            text-align: center;
        }
        /*.kc,.sj{
            margin-left: 20%;
        }*/
        .hide{
            display: none;
        }
    </style>
</head>
<body>
<div class="title">
    <h3>项目名称:</h3>
    <h3 id="prjName"></h3>
    <div class="offer"><a class="layui-btn layui-btn-normal layui-btn-xs record" lay-event="record">报价记录</a></div>
</div>

<p style="margin-top: 10px;">
    审查机构入围政府购买服务的项目时，系统按照规定预设一段时间等待入围的审查机构完成在线报价工作，审查机构报价后，由主管机构对报价进行确认，超时未报价视为放弃。报价不可超过费用上限。</p>
<table class="layui-table" lay-filter="example"style="margin-top: 10%;">
    <colgroup>
        <col>
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>勘察审查费用上限</th>
        <th>施工图审查费用上限</th>
        <th>勘察审查时限</th>
        <th>施工图审查时限</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td id="selectKcCost"></td>
        <td id="selectSjCost"></td>
        <td id="kcDay"></td>
        <td id="sjDay"></td>
    </tr>
    </tbody>
</table>
<form class="layui-form searchForm" id="form" action="" lay-filter="example">
    <input type="hidden" name="priceId" class="priceId formData" value="">
    <input type="hidden" name="decId" class="decId formData" value="">
    <div class="layui-form-item">
        <div class="layui-inline kc hide">
            <label class="layui-form-label" style="width: 105px;">勘察审查费用：</label>
            <div class="layui-input-inline">
                <input type="text" name="kcCost"   autocomplete="off" class="layui-input formData">
            </div>
            <div class="layui-form-mid">元</div>
        </div>
        <div class="layui-inline sj hide" style="margin-left: 65px">
            <label class="layui-form-label" style="width: 120px;">施工图审查费用：</label>
            <div class="layui-input-inline">
                <input type="text" name="sjCost"  autocomplete="off" class="layui-input formData">
            </div>
            <div class="layui-form-mid">元</div>
        </div>
    </div>
    <button lay-submit lay-filter="submit" style="display: none;" id="submit" class="demo1">提交</button>
</form>
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    var configureCom = {};
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'table', 'matchDict', 'table',], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var table = layui.table;
        var matchDict = layui.matchDict;
        var configureCom = layui.configureCom;
        var sessionFun = layui.sessionFun;//存储session

        var listData = sessionFun.get(configure.SESSION_PROJECT_LIST_DATA);//获取 存储的session
        console.log(listData);
        if (listData.submitExamInfo.indexOf('1') > -1){//勘察
            $('.kc').removeClass('hide');
        }
        if(listData.submitExamInfo.indexOf('2') > -1 || listData.submitExamInfo.indexOf('3') > -1){//设计
            $('.sj').removeClass('hide');
        }
        if(listData.submitExamInfo.indexOf('1') > -1 && listData.submitExamInfo.indexOf('2') > -1 || listData.submitExamInfo.indexOf('3') > -1){
            $('.sj').removeClass('hide');
            $('.kc').removeClass('hide');
        }
        var prjData = {
            priceId: listData.priceId,
            decId: listData.decId,
            kcCost: listData.kcCost,
            sjCost: listData.sjCost
        };
        form.val('example', prjData);
        $.each(listData, function (index , value) {
            $('#'+index).html(value);
        });

        //报价记录
        $('.record').on('click', function () {
            var decId = listData.decId;
            top.layer.open({
                type: 2,
                title: '报价记录',
                area: configureCom.Psize4,//弹窗宽高设置
                btnAlign: 'c',
                btn: ['关闭'],
                content: configureCom.nocache(configure.EXAMINE_RECORD_HTML)
            });
        });
        window.$ = layui.jquery;

        form.render();
        //监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });

    });
    function getData() {
        return new Promise(function (res, rej) {
            var data = {};
            if (!window.formVerifyFun()) {
                return false;
            }
            $('.formData').each(function (index, item) {
                var key = $(item).attr('name');
                data[key] = $(item).val();
            });
            res({result: data});
        });
    }
</script>
</body>
</html>